﻿import com.dmotiko.lib.EventDispatcherPro;
import com.dmotiko.mirador.*
import com.dmotiko.general.*
import mx.transitions.*;
import mx.transitions.easing.*;
import mx.utils.Delegate;

class MiradorSiteSection
extends WebSiteSection {
		
	function MiradorSiteSection( app:MiradorSite ) {
		super( app );
		bShowed = false;
	}
	
	public function showSection() {
		if (bShowed) return;
		//MiradorSite.getApp().log( "MiradorSiteSection | showSection= " + sName);
		bShowed = true;
		this.gotoAndStop(2);
		this._alpha = 100;
		//MiradorSite.getApp().setActiveSection(this);
		showEnd();
		//registerTween("fade", new Tween(this, "_alpha", Regular.easeOut, this._alpha, 100, 0.7, true), false, true);
	}
	
	public function hideSection() {
		if (!bShowed) return;
		//MiradorSite.getApp().log( "MiradorSiteSection | hideSection= " + sName);
		bShowed = false;
		this._alpha = 0;
		this.gotoAndStop(1);
		hideEnd();
		//registerTween("fade", new Tween(this, "_alpha", Regular.easeOut, this._alpha, 0, 0.7, true), false, true);
	}
	private function tweenFinished(key:String, tween:Tween):Void {
		if ( bShowed ) {
			EventDispatcherPro.removeEventListenersForTagName( WebSiteSection.HIDE_END ); //elimino los listeners de ese tag
			MiradorSite.getApp().setActiveSection(this);
			showEnd();
		} else {
			this.gotoAndStop(1);
			hideEnd();
		}
	}
	
}